<?php
session_start();
error_reporting(0);
include_once 'inc/conn.php';
include_once 'inc/safemode.php';
require_once('inc/360_safe3.php');
?>
<?php
$urls=trim(htmlspecialchars($_REQUEST['urls']));
$appid=trim(htmlspecialchars($_REQUEST['appid']));
$userkey=trim(htmlspecialchars($_REQUEST['userkey']));
$fanhui=trim(htmlspecialchars($_REQUEST['fanhui']));
$jiekou=trim(htmlspecialchars($_REQUEST['jiekou']));
$adminname=trim(htmlspecialchars($_REQUEST['adminname']));
$password=trim(htmlspecialchars($_REQUEST['password']));

if ($urls=="" or $appid=="" or $userkey=="" or $jiekou=="" or $adminname=="" or $password==""){
exit("&#21442;&#25968;&#22635;&#20889;&#19981;&#27491;&#30830;&#35831;&#37325;&#26032;&#22635;&#20889;");
}else{

    $api = 1;
    if ($api == "1") {
        $sql = "create table ewmddh (id int(11) not null auto_increment primary key,pay varchar(20) ,name varchar(255),cny varchar(255),uid varchar(255),appid varchar(255),timm varchar(255),dingdanok int(8) default '0',ddh varchar(255))DEFAULT CHARSET=utf8";
        $sqll = "create table ewmszb (id int(11) not null auto_increment primary key,pay varchar(20) ,name varchar(255) ,cny varchar(255) ,appid varchar(255) ,picurl varchar(255) ,ewmurl varchar(255) ,fenzuid varchar(255) ,timm varchar(255))DEFAULT CHARSET=utf8";
		$sql2 = "create table ewmzu (id int(11) not null auto_increment primary key,zuname varchar(20) ,money float(20) ,appid varchar(255))DEFAULT CHARSET=utf8";
		$sql3 = "create table ewmadmin (id int(11) not null auto_increment primary key,adminname varchar(255),password varchar(255),type varchar(255),custom1 varchar(255),custom2 varchar(255),custom3 varchar(255),custom4 varchar(255),custom5 varchar(255),custom6 varchar(255),urls varchar(255),appid varchar(255),userkey varchar(255),fkok int(2),jiekou varchar(255),fanhui varchar(255))DEFAULT CHARSET=utf8";
        mysql_query($sql);
        mysql_query($sqll);
		mysql_query($sql2);
		mysql_query($sql3);

		$password= md5($password);
	    $types = "add_balance";
		$custom1= "1";
		$custom2= "approved";
		$custom3= time();
		$custom4= "1000000";
		$custom5= "0";
		$custom6=1;
		$fkok="1";

		$in_admin_pwd = "INSERT INTO `ewmadmin` (`id`, `adminname`, `password`, `type`, `custom1`, `custom2`, `custom3`, `custom4`, `custom5`, `custom6`, `urls`, `appid`, `userkey`, `fkok`, `jiekou`, `fanhui`) VALUES(1, '". $adminname ."', '".$password ."', '". $types ."', '". $custom1."', '". $custom2 ."', '". $custom3 ."', '". $custom4 ."', '". $custom5 ."', '". $custom6 ."', '". $urls ."', '". $appid ."', '". $userkey ."', '". $fkok ."', '". $jiekou ."', '". $fanhui ."')";
        mysql_query($in_admin_pwd) or die("&#28155;&#21152;&#25968;&#25454;&#20449;&#24687;&#38169;&#35823;<br /><a href='javascript:history.go(-1);'>&#36820;&#22238;</a>");
		
        echo "&#23433;&#35013;&#25968;&#25454;&#20449;&#24687;&#23436;&#25104;&#65292;&#35831;&#24517;&#39035;&#21024;&#38500;install.php&#21644;newshujb.php&#25991;&#20214;&#21542;&#21017;&#21518;&#26524;&#33258;&#36127;&#65292;&#35831;<a href='index.php'><font color='#FF0000'>&#30331;&#38470;</font></a>&#28155;&#21152;&#37329;&#39069;&#20998;&#32452;";
    }
}
?>